package secret

import (
	"kms-backend/controllers/secret"

	"github.com/gin-gonic/gin"
)

// 新增
func create(secretGroup *gin.RouterGroup) {
	secretGroup.POST("/create", secret.Create)
}

// 更新
func update(secretGroup *gin.RouterGroup) {
	secretGroup.POST("/update", secret.Update)
}

func detail(secretGroup *gin.RouterGroup) {
	secretGroup.GET("/detail", secret.Detail)
}

func list(secretGroup *gin.RouterGroup) {
	secretGroup.GET("/list", secret.List)
}

func delete(secretGroup *gin.RouterGroup) {
	secretGroup.POST("/delete", secret.Delete)
}

func RegisterSubRouter(g *gin.RouterGroup) {
	// 配置路由策略
	secretGroup := g.Group("/secret")
	create(secretGroup)
	update(secretGroup)
	detail(secretGroup)
	list(secretGroup)
	delete(secretGroup)

}
